Skip to content

Conversation

@steveklabnik
Copy link
Collaborator

Convert all InstData variants that embedded Vec to use the extra array pattern (start: u32, len: u32). This follows the Zig ZIR approach.

Affected variants:

  • Match: arms now in extra array
  • FnDecl: directives and params now in extra array
  • Call, MethodCall, AssocFnCall, Intrinsic: args now in extra array
  • ArrayInit: elements now in extra array
  • StructInit, StructDecl: fields now in extra array
  • EnumDecl: variants now in extra array
  • ImplDecl: methods now in extra array
  • Alloc: directives now in extra array

Benefits:

  • Reduces InstData enum size from ~64+ bytes to ~24 bytes
  • Eliminates per-instruction heap allocations
  • Improves cache locality during IR traversal

🤖 Generated with Claude Code

@steveklabnik steveklabnik force-pushed the steveklabnik/push-smsllxqqozty branch 6 times, most recently from 4f8684b to ea17241 Compare December 29, 2025 16:10
Convert all InstData variants that embedded Vec<T> to use the extra
array pattern (start: u32, len: u32). This follows the Zig ZIR approach.

Affected variants:
- Match: arms now in extra array
- FnDecl: directives and params now in extra array  
- Call, MethodCall, AssocFnCall, Intrinsic: args now in extra array
- ArrayInit: elements now in extra array
- StructInit, StructDecl: fields now in extra array
- EnumDecl: variants now in extra array
- ImplDecl: methods now in extra array
- Alloc: directives now in extra array

Benefits:
- Reduces InstData enum size from ~64+ bytes to ~24 bytes
- Eliminates per-instruction heap allocations
- Improves cache locality during IR traversal

Fix: Use try_from_usize instead of non-existent from_usize_unchecked
in Symbol::from_raw.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <[email protected]>
@steveklabnik steveklabnik force-pushed the steveklabnik/push-smsllxqqozty branch from ea17241 to 0c37081 Compare December 31, 2025 03:44
@steveklabnik steveklabnik added this pull request to the merge queue Dec 31, 2025
Merged via the queue into rue-language:trunk with commit b3dc348 Dec 31, 2025
4 checks passed
@steveklabnik steveklabnik deleted the steveklabnik/push-smsllxqqozty branch December 31, 2025 03:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant